// import controller from "@/controller/UserApi.js";

const person = {
    state:{
        //头像
        avatar:'@/assets/police.jpeg',
        //昵称
        name:'',
        
        //二维码
        QRcode:'',
        
    },
    getters:{
  
    },
    mutations:{
        SET_AVATAR :(state,avatar)=>{
            state.avatar = avatar
        },
        SET_PLOICE_NUMBER :(state,policeNumber)=>{
            state.policeNumber = policeNumber
        },
        SET_GENDER :(state,gender)=>{
            state.gender = gender
        },
        SET_BIRTHDAY :(state,birthday)=>{
            state.birthday = birthday
        },
        SET_ADDRESS :(state,address)=>{
            state.address = address
        },
        SET_POSITION :(state,position)=>{
            state.position = position
        },
        SET_NAME :(state,name)=>{
            state.name = name
        },
        SET_POLICEASSISTANT :(state,police_assistant)=>{
            state.police_assistant = police_assistant
        },
        SET_MESSAGESTATUS:(state,status1)=>{
            state.messageStatus = status1
        },
        SET_PHONRENUMBER:(state,phoneNumber)=>{
            state.phoneNumber = phoneNumber
        },
        
        
    },
    actions:{
        getAvatar({commit,state}){
            commit('SET_AVATAR',state.avatar)
        },
        getPloiceNumer({commit,state}){
            commit('SET_PLOICE_NUMBER',state.policeNumber)
        },
        getGender({commit,state}){
            commit('SET_GENDER',state.gender)
        },
        getAddress({commit,state}){
            commit('SET_ADDRESS',state.address)
        },
        getBirthday({commit,state}){
            commit('SET_BIRTHDAY',state.birthday)
        },
        getPosition({commit,state}){
            commit('SET_POSITION',state.position)
        },
        getName({commit,state}){
            commit('SET_NAME',state.name)
        },
        getConcat({commit,state}){
            commit('SET_CONCAT',state.concat)
        },
        getStatus({commit,state}){
            commit('SET_MESSAGESTATUS',state.messageStatus)
        },
        getPhoneNumber({commit,state}){
            commit('SET_PHONRENUMBER',state.phoneNumber)
        },
        getPoliceAssistant({commit,state}){
            commit('SET_POLICEASSISTANT',state.police_assistant)
        },
        // getPersonInformation({commit,state},id){
        //     controller.getPersonalInformation(id).then(res1=>{
        //         let res = res1[0]
        //         commit('SET_NAME',res.nickname)
        //         commit('SET_POSITION',res.duty)
        //         commit('SET_ADDRESS',res.district)
        //         commit('SET_GENDER',res.gender)
        //         commit('SET_PLOICE_NUMBER',res.police_assistant)
        //         commit('SET_AVATAR',res.head_portrait)
        //         commit('SET_BIRTHDAY',res.birthday)
        //         commit('SET_PHONRENUMBER',res.telphone)
        //         commit('SET_POLICEASSISTANT',res.police_assistant)
        //     }).catch(err => {
        //     })
        // }
        
    },
    
  }
  
  export default person